package com.itHuangTao.tank.components;

import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.entity.component.Component;

public class FlagComponent extends Component {
    public void onHit(){
        //清除当前视图组件
        entity.getViewComponent().clearChildren();
        //换上失败后的旗帜视图组件
        entity.getViewComponent().addChild(FXGL.texture("flag_failed.png"));
    }

}
